package edu.gdut.thesissys.vo;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TaskBook entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "task_book", catalog = "gdutmis")
public class TaskBook extends BaseVo implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -3004053956891193544L;
	private Integer taskBookId;
	private String content;
	private String request;
	private String workContent;
	private String literature;
	private Date sendDate;
	private Date finishDate;
	private String state;
	private Set<StudentChooseTitle> studentChooseTitles = new HashSet<StudentChooseTitle>(
			0);
	private Set<Scheduling> schedulings = new HashSet<Scheduling>(0);

	// Constructors

	/** default constructor */
	public TaskBook() {
	}

	/** full constructor */
	public TaskBook(String content, String request, String workContent,
			String literature, Date sendDate, Date finishDate, String state,
			Set<StudentChooseTitle> studentChooseTitles,
			Set<Scheduling> schedulings) {
		this.content = content;
		this.request = request;
		this.workContent = workContent;
		this.literature = literature;
		this.sendDate = sendDate;
		this.finishDate = finishDate;
		this.state = state;
		this.studentChooseTitles = studentChooseTitles;
		this.schedulings = schedulings;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "task_book_id", unique = true, nullable = false)
	public Integer getTaskBookId() {
		return this.taskBookId;
	}

	public void setTaskBookId(Integer taskBookId) {
		this.taskBookId = taskBookId;
	}

	@Column(name = "content", length = 65535)
	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Column(name = "request", length = 65535)
	public String getRequest() {
		return this.request;
	}

	public void setRequest(String request) {
		this.request = request;
	}

	@Column(name = "work_content", length = 65535)
	public String getWorkContent() {
		return this.workContent;
	}

	public void setWorkContent(String workContent) {
		this.workContent = workContent;
	}

	@Column(name = "literature", length = 65535)
	public String getLiterature() {
		return this.literature;
	}

	public void setLiterature(String literature) {
		this.literature = literature;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "send_date", length = 10)
	public Date getSendDate() {
		return this.sendDate;
	}

	public void setSendDate(Date sendDate) {
		this.sendDate = sendDate;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "finish_date", length = 10)
	public Date getFinishDate() {
		return this.finishDate;
	}

	public void setFinishDate(Date finishDate) {
		this.finishDate = finishDate;
	}

	@Column(name = "state", length = 1)
	public String getState() {
		return this.state;
	}

	public void setState(String state) {
		this.state = state;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "taskBook")
	public Set<StudentChooseTitle> getStudentChooseTitles() {
		return this.studentChooseTitles;
	}

	public void setStudentChooseTitles(
			Set<StudentChooseTitle> studentChooseTitles) {
		this.studentChooseTitles = studentChooseTitles;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "taskBook")
	public Set<Scheduling> getSchedulings() {
		return this.schedulings;
	}

	public void setSchedulings(Set<Scheduling> schedulings) {
		this.schedulings = schedulings;
	}

}